<template>
  <div>
      {{ strTime }}
  </div>
</template>

<script>

import {formatDate}  from "@/utils/drawdat/date"

export default {
  name: 'ZoneTime',
  components: {
     
  },

  data() {
    return {
        timerId: 0,
        strTime : "",
    }
  },

  created() {
    this.timerId = setInterval(() => this.updateTime(), 1000);
    // console.log( "create timer" )
  },

  beforeDestroy() {
    clearInterval(this.timerId);
  },

  mounted() {

  },

  unmounted() {

  },

  methods: {
    updateTime() {
      var now =  new Date(  )
      this.strTime =  formatDate( now, "yyyy-MM-dd hh:mm:ss" )
      // console.log( this.strTime )
    },
  }
}
</script>


<style scoped>
</style>

